1. Field of the Invention
The present invention relates to computer readable source projects, and more particularly to methods for determining a program structure associated with computer readable source projects.
2. Background Art
Computer readable source projects (“source projects”) typically have a number of source code units and can have other supporting files, such as libraries, header files, and the like. Depending on the programming language and/or development environment, some source projects include a makefile that specifies project build instructions to an expert build utility, a so-called make. Alternatively, custom scripts may be deployed to build a source project.
Source projects are commonly edited via an integrated development environment (“IDE”). The IDE develops a model for a given source project by acclimating itself to the project's build conditions and other specifications. Certain IDEs include a make-based build utility and are thereby capable of building makefile-based source projects. However, these IDEs often do not know specific compilation details for various source files in the project. This is particularly true for very large projects which can contain thousand of files and tens of thousands of lines of code or more. Frequently, a developer will be confronted with a large software project that has already been developed. It is rare that a developer will develop such a large program from scratch. Even if they do, they frequently start off by modifying some large code. In such circumstances, a developer will bring the project into his or her environment of choice.
IDEs provide developers with the ability to understand and perhaps modify the code. Toward this goal, IDEs allow browsing through the large body of code at a source level. For example, an IDE may allow navigation from a statement to the location where the statement was first defined. IDEs also provide a feature called code assistance. Code assistance is a type of context help in which a developer is given information at each location in the code regarding functionality that is available and possibly the ability to automatically make changes to the code. IDEs may also provide the ability to distinguish active from inactive code (e.g., preprocessor directive that enable or disable a volume of code depending on the operating system). Finally, an effective IDE would show errors such as typographical errors or undefined symbols.
In order to function properly, IDEs need a good knowledge of the structure of the software project under consideration. Incomplete or inaccurate knowledge can result in an inconsistent information about the program structure. Consequently, a makefile-based source project may not be properly resolved (or parsed) by an internal IDE's parser. In this scenario, a user may be misinformed about the structure of the program. For example, hyperlinks, code completion, tool tips, source code highlighting, and etc. may not function properly. Furthermore, makefiles only track files necessary for the compilation of a source project. Therefore, files which may have been removed by a user after compilation (e.g. by removing an “include” preprocessor directive) may remain as part of the source project, resulting in an inconsistency between the actual project and the projected as presented to a user.
If a makefile is utilized, one way to provide accurate information regarding a program structure for use in an IDE is to manually analyze the makefile and specify missing information to the IDE (e.g. via a project properties option set). However, due to the complexity of makefiles, this method may be time consuming or not possible.
Accordingly, for at least these reasons, there is a need for robust methods of determining a program structure applicable to large complex programming projects.